# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=brutessh
pkgver=0.6
pkgrel=5
pkgdesc="A simple sshd password bruteforcer using a wordlist, it's very fast for internal networks. It's multithreads."
url='http://www.edge-security.com/edge-soft.php'
groups=('blackarch' 'blackarch-cracker')
license=('GPL')
arch=('any')
depends=('python2' 'python2-paramiko')
source=("http://www.edge-security.com/soft/$pkgname-$pkgver.tar")
sha512sums=('445ba0282cf8c854bdc99d2a039818b6956ba175658ed393f4a2fd708ac635b657d36a9bd6bb859a91af97289d2fafd0125ee1610d7c147ddb493fad606c2b5b')

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/$pkgname" *.py
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 $pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

